package com.conan.spring5.Test;

import com.conan.spring5.bean.Order;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


/**
 * @version 加油！！！
 * @Description
 * @Author 谷藤新一GYC
 * @Date 2022/10/21 - 8:56
 */
public class OrderTest {
    @Test
    public void test1(){
//        ApplicationContext context = new ClassPathXmlApplicationContext("bean4.xml");
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean4.xml");
        Order order = context.getBean("order", Order.class);
        System.out.println("第四步:获取创建bean实例对象");
        System.out.println(order);

        //手动让bean实例销毁
        context.close();
    }
}
   